package com.glela.common.util;

import java.math.BigDecimal;

/**doubel 2 decimal
 * @author liujie
 *
 */
public class DoubleToDecimalInnerUtil {
	public static double double2Decimal(double value) {
 		BigDecimal decimal = new BigDecimal(Double.toString(value));
 		double result = decimal.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue();
 		return result;
	}  
	
	public static double decimal2Double(BigDecimal decimal) {
  		double result = decimal.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue();
 		return result;
	}  
}
